#include <stdio.h>

typedef struct Std 
{
    char Name[20];
    int Age;
    int ID;
}Std;

int main()
{
    Std S1 = {{"Haines",20,2012141690},{"Haines2",25,2012112390}};

    FILE * fp = fopen("/home/haiyang/wendang/test_C/25-3/3-4 .text","a");
    if (NULL == fp){
        printf("%s \n","error open file");
        return -1;
    }

    fprintf(fp,"%s\n",S1. Name);
    fprintf(fp,"%d\n",S1. Age);
    fprintf(fp,"%d\n",S1. ID);

    fclose(fp);


    printf("Data written to file successfully.\n");

    return 0;
}

